package com.medisched.medisched.service.impl;

import com.medisched.medisched.domain.Usertable;
import com.medisched.medisched.mapper.UsertableMapper;
import com.medisched.medisched.service.IUsertableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class UsertableServiceImpl implements IUsertableService
{
    @Autowired
    private UsertableMapper usertableMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public Usertable selectUsertableById(Long id)
    {
        return usertableMapper.selectUsertableById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param usertable 用户
     * @return 用户
     */
    @Override
    public List<Usertable> selectUsertableList(Usertable usertable)
    {
        return usertableMapper.selectUsertableList(usertable);
    }

    /**
     * 新增用户
     * 
     * @param usertable 用户
     * @return 结果
     */
    @Override
    public int insertUsertable(Usertable usertable)
    {
        return usertableMapper.insertUsertable(usertable);
    }

    /**
     * 修改用户
     * 
     * @param usertable 用户
     * @return 结果
     */
    @Override
    public int updateUsertable(Usertable usertable)
    {
        return usertableMapper.updateUsertable(usertable);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteUsertableByIds(Long[] ids)
    {
        return usertableMapper.deleteUsertableByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteUsertableById(Long id)
    {
        return usertableMapper.deleteUsertableById(id);
    }

    @Override
    public Usertable selectUserAlltableById(Long id) {
        return usertableMapper.selectUserAlltableList(id);
    }
}
